#include "point.h"


float Point::getRo() const
{
	Point origin(0,0,0);
	return distance(origin);
}

float Point::getTheta() const
{
	return atan2( x , z ) * 180 / acos(-1.0); //atan2 returns Rads...
}

float Point::getPhi() const
{
	return acos( y / getRo() );
}


Point Point::operator+ (const Point& other) const
{
	return Point(getX() + other.getX(),
				 getY() + other.getY(),
				 getZ() + other.getZ() );
}

Point& Point::operator+= (const Point& other)
{
	setX(getX() + other.getX());
	setY(getY() + other.getY());
	setZ(getZ() + other.getZ());

	return *this;
}

Point Point::operator- (Point other) const
{
	return Point(getX() - other.getX(),
				 getY() - other.getY(),
				 getZ() - other.getZ() );
}

